package com.eastfair.imaster.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.eastfair.annotation.model.EchoVO;
import com.eastfair.core.base.entity.Entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import javax.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 
 * </p>
 *
 * @author liuxiaobai
 * @since 2021-08-31
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("i_business_circle")
@ApiModel(value = "BusinessCircle", description = "")
@AllArgsConstructor
public class BusinessCircle extends Entity<Long> implements EchoVO {

    private static final long serialVersionUID = 1L;
    @TableField(exist = false)
    private Map<String, Object> echoMap = new HashMap<>();
    /**
     * 项目ID
     */
    @ApiModelProperty(value = "项目ID")
    @TableField(value = "project_id")
    @Excel(name = "项目ID")
    private Long projectId;

    /**
     * 展会ID
     */
    @ApiModelProperty(value = "展会ID")
    @TableField(value = "exhibition_id")
    @Excel(name = "展会ID")
    private Long exhibitionId;

    /**
     * 发送人userId
     */
    @ApiModelProperty(value = "发送人userId")
    @TableField(value = "user_id")
    @Excel(name = "发送人userId")
    private Long userId;

    /**
     * 发送人身份（主办、观众、展商）
     */
    @ApiModelProperty(value = "发送人身份（主办、观众、展商）")
    @Size(max = 32, message = "发送人身份（主办、观众、展商）长度不能超过32")
    @TableField(value = "user_type", condition = LIKE)
    @Excel(name = "发送人身份（主办、观众、展商）")
    private String userType;

    /**
     * 商脉圈类型,TEXT:文本,IMAGE:图片,VIDEO:视频,PRODUCT:展品
     */
    @ApiModelProperty(value = "商脉圈类型,TEXT:文本,IMAGE:图片,VIDEO:视频,PRODUCT:展品")
    @Size(max = 32, message = "商脉圈类型,TEXT:文本,IMAGE:图片,VIDEO:视频,PRODUCT:展品长度不能超过32")
    @TableField(value = "subject_type", condition = LIKE)
    @Excel(name = "商脉圈类型,TEXT:文本,IMAGE:图片,VIDEO:视频,PRODUCT:展品")
    private String subjectType;

    /**
     * 标题
     */
    @ApiModelProperty(value = "标题")
    @Size(max = 100, message = "标题长度不能超过100")
    @TableField(value = "title", condition = LIKE)
    @Excel(name = "标题")
    private String title;

    /**
     * 内容
     */
    @ApiModelProperty(value = "内容")
    @Size(max = 65535, message = "内容长度不能超过65535")
    @TableField(value = "content", condition = LIKE)
    @Excel(name = "内容")
    private String content;

    /**
     * 缩略图地址
     */
    @ApiModelProperty(value = "缩略图地址")
    @Size(max = 512, message = "缩略图地址长度不能超过512")
    @TableField(value = "thumbnail", condition = LIKE)
    @Excel(name = "缩略图地址")
    private String thumbnail;

    /**
     * 图片地址/视频地址/展品ID
     */
    @ApiModelProperty(value = "图片地址/视频地址/展品ID")
    @Size(max = 65535, message = "图片地址/视频地址/展品ID长度不能超过65535")
    @TableField(value = "media_url", condition = LIKE)
    @Excel(name = "图片地址/视频地址/展品ID")
    private String mediaUrl;

    /**
     * 点赞数
     */
    @ApiModelProperty(value = "点赞数")
    @TableField(value = "like_num")
    @Excel(name = "点赞数")
    private Integer likeNum;

    /**
     * 审核状态
     */
    @ApiModelProperty(value = "审核状态")
    @Size(max = 30, message = "审核状态长度不能超过30")
    @TableField(value = "verify_state", condition = LIKE)
    @Excel(name = "审核状态")
    private String verifyState;

    /**
     * 审核意见
     */
    @ApiModelProperty(value = "审核意见")
    @Size(max = 500, message = "审核意见长度不能超过500")
    @TableField(value = "verify_content", condition = LIKE)
    @Excel(name = "审核意见")
    private String verifyContent;

    /**
     * 是否置顶（0-否 1-是）
     */
    @ApiModelProperty(value = "是否置顶（0-否 1-是）")
    @TableField(value = "is_top")
    @Excel(name = "是否置顶（0-否 1-是）")
    private Integer isTop;

    /**
     * 是否生效(默认1：可用 0:不可用)
     */
    @ApiModelProperty(value = "是否生效(默认1：可用 0:不可用)")
    @TableField(value = "is_enable")
    @Excel(name = "是否生效(默认1：可用 0:不可用)")
    private Integer isEnable;

    /**
     * 是否删除(默认0：未删除1:已删除)
     */
    @ApiModelProperty(value = "是否删除(默认0：未删除1:已删除)")
    @TableField(value = "is_delete")
    @Excel(name = "是否删除(默认0：未删除1:已删除)")
    private Integer isDelete;


    @Builder
    public BusinessCircle(Long id, Long createdBy, LocalDateTime createTime, Long updatedBy, LocalDateTime updateTime, 
                    Long projectId, Long exhibitionId, Long userId, String userType, String subjectType,
                    String title, String content, String thumbnail, String mediaUrl, Integer likeNum, String verifyState, 
                    String verifyContent, Integer isTop, Integer isEnable, Integer isDelete) {
        this.id = id;
        this.createdBy = createdBy;
        this.createTime = createTime;
        this.updatedBy = updatedBy;
        this.updateTime = updateTime;
        this.projectId = projectId;
        this.exhibitionId = exhibitionId;
        this.userId = userId;
        this.userType = userType;
        this.subjectType = subjectType;
        this.title = title;
        this.content = content;
        this.thumbnail = thumbnail;
        this.mediaUrl = mediaUrl;
        this.likeNum = likeNum;
        this.verifyState = verifyState;
        this.verifyContent = verifyContent;
        this.isTop = isTop;
        this.isEnable = isEnable;
        this.isDelete = isDelete;
    }

}
